// Copyright (c) 2012-2021 VLINGO LABS. All rights reserved.
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL
// was not distributed with this file, You can obtain
// one at https://mozilla.org/MPL/2.0/.

using System;

namespace Vlingo.Actors
{
    internal class ActorAddressAlreadyRegisteredException : Exception
    {
        public ActorAddressAlreadyRegisteredException(Actor actor, IAddress address) : this(actor.GetType(), address)
        {
        }
        
        public ActorAddressAlreadyRegisteredException(Type? type, IAddress address)
            : base($"Failed to register Actor of type {type?.FullName}. Address is already registered: {address}")
        {
        }
    }
}